	
var scene = new THREE.Scene();
        
var camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 100); 
	

var renderer = new THREE.WebGLRenderer( { clearColor: 0xffffff, clearAlpha: 1 } );
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
//Position camera par defaut
camera.position.z = 20;
camera.position.x = 2;
camera.position.y = 5; 
// create a point light
var pointLight =new THREE.PointLight(0xFFFFFF);
// set its position
pointLight.position.x =100;
pointLight.position.y = 130;
pointLight.position.z = 100;
// add to the scene
scene.add(pointLight);
//Affichage Grille par defaut
afficherGrille(scene,100,100,1);

controls = new THREE.TrackballControls( camera, renderer.domElement );
controls.target.set( 0, 0, 0 );
var objects = [];
projector = new THREE.Projector();
	
// envoie d'une requette http au serveur
var req = new XMLHttpRequest();
var fileListReqUrl = "http://localhost:8080/WebServiceTemperatureFinal/app/Json/dataBetween?startDate=02012001&endDate=04012001";
req.open("GET",fileListReqUrl,true); 
req.onreadystatechange = function(){
    if (req.readyState == 4) 
    { 
        var echantillon = eval('(' + req.responseText + ')'); 
        updateViewFromReceivedData(echantillon);
    // render();
    }
};   // la fonction de prise en charge
req.send(null);	         


render();

function render() {
    controls.update();
    requestAnimationFrame(render); 
    renderer.render(scene, camera);
}
     
        
	
	
	
	
